#include <stdio.h>            // MUST follow these 5 steps in about the right order !!!
#include "khash.h"            // 1. include khash.h

typedef const char *key_type; // 2. typde key_type
typedef double val_type;      //    and val_type 
#define MISSING_VALUE 999.999       // 3. define MISSING. to match val_type
HASH_INIT_STR_KEYS(val_type)  // 4. initialize. (either HASH_INIT_STR_KEYS or HASH_INIT_INT_KEYS)

#include "khash_sugar.h"      // 5. include khash_sugar.h


int main() {
    hash *h = hash_new();
    char *key = "asdfasdf";
    double value = 3.11;
    hash_put(h, key, value);

    printf("%f\n", hash_get(h, key));
    printf("%f\n", hash_get(h, "ggg"));
    printf("%f\n", hash_get(h, key));
    printf("%i\n", hash_contains(h, key));
    printf("%i\n", hash_contains(h, "aa"));

    hash_put(h, key, 2222.0000);

    printf("%i\n", hash_size(h));
    printf("%f\n", hash_get(h, key));
    hash_delete(h, key);
    printf("%f\n", hash_get(h, key));

    hash_clear(h);
    hash_free(h);
    return 0;
}

